package com.yserp.project.erp.order.purchorder.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yserp.common.utils.mybatis.MybatisPlusUtil;
import com.yserp.project.erp.order.purchorder.domain.PurchOrderItem;
import com.yserp.project.erp.order.purchorder.mapper.PurchOrderItemMapper;
import com.yserp.project.erp.order.purchorder.service.IPurchOrderItemService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 采购订单子Service业务层处理
 * 
 * @author yserp
 * @date 2022-08-02
 */
@Service
public class PurchOrderItemServiceImpl extends ServiceImpl<PurchOrderItemMapper, PurchOrderItem> implements IPurchOrderItemService
{
    @Resource
    private PurchOrderItemMapper purchOrderItemMapper;



    /**
     * 查询采购订单子列表
     * 
     * @param purchOrderItem 采购订单子
     * @return 采购订单子
     */
    @Override
    public List<PurchOrderItem> selectPurchOrderItemList(PurchOrderItem purchOrderItem) {
        QueryWrapper<PurchOrderItem> query = new QueryWrapper<>();
        MybatisPlusUtil.notNullField(purchOrderItem,query);
        return purchOrderItemMapper.selectList(query);
    }

    @Override
    public List<PurchOrderItem> selectPurchOrderItemListByMainId(Long mainId) {
        PurchOrderItem purchOrderItem =new PurchOrderItem();
        purchOrderItem.setMainId(mainId);
        return this.selectPurchOrderItemList(purchOrderItem);
    }


}
